import torch

#print(torch.cuda.is_available())

#print(torch.cuda.get_device_name(0))

#t1= torch.tensor([6, 2])

#print(t1.shape)

#print(torch.zeros(2, 3, 4))

x = torch.randn(3, 4)

#print(x)
#print(x[0, 0])

#print(x[0, 1:3])

x = torch.ones(2, 2, requires_grad=True)
y = 2 * x + 2
z = y.sum()
print(z)
z.backward()
print(x.grad)

y2 = 2 * x
print(y2.requires_grad)

with torch.no_grad():
    y2 = 2 * x
    print(y2.requires_grad)

